import { EntityTypeEnum, InputTypeEnum } from "./Enum";

export interface IVec2{
    x:number,
    y:number,
}

export interface IActor{
    id:number,
    hp:number,
    nickname:string;
    position:IVec2,
    direction:IVec2,
    type:EntityTypeEnum,
    weaponType:EntityTypeEnum,
    bulletType:EntityTypeEnum,
}

export interface IBullet{
    id:number,
    owner: number,
    position:IVec2,
    direction:IVec2,
    type:EntityTypeEnum,
}
export interface IState {
    actors:IActor[],
    bullets:IBullet[],
    nextBulletId:number,
    //随机数种子（用于暴击）
    seed:number, 
}

//做个联合类型，datamanager里用
export type IClientInput = IActorMove | IWeaponShoot |ITimePast;

export interface IActorMove{
    id:number,
    type:InputTypeEnum.ActorMove,
    direction:IVec2,
    dt:number,
}

export interface IWeaponShoot{
    type:InputTypeEnum.WeaponShoot,
    owner:number,
    position:IVec2,
    direction:IVec2,
}

export interface ITimePast{
    type:InputTypeEnum.TimePast,
    dt:number,
}